package phapp.service.barapp.impl;

import static javacommon.util.Struts2JsonHelper.outJson;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;
import javacommon.base.*;

import phapp.model.barapp.*;
import phapp.dao.barapp.*;
import phapp.service.barapp.impl.*;
import phapp.service.barapp.*;
/**
 * <p> 标题: 会员交友日志表, tc_vip_log_friend_info  业务处理层
 * <p>Description: spring事务实现层,调用Dao层取数据
 * <p>Copyright: Copyright (c) 2014-10
 * <p>Company: 
 * @see phapp.model.barapp.VipLogFriend
 * @see phapp.service.barapp.VipLogFriendManager
 * @see phapp.dao.barapp.VipLogFriendDao
 * @author you name
 * @version 1.0
*/

@Component("vipLogFriendManager")
@Transactional
public class VipLogFriendManagerImpl extends BaseManager<VipLogFriend,java.lang.Integer>
               implements VipLogFriendManager {

   /**定义Dao*/
   private VipLogFriendDao vipLogFriendDao;
   /**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性*/
   public void setVipLogFriendDao(VipLogFriendDao dao) {
      this.vipLogFriendDao = dao;
   }

   /**获取Dao*/
   public EntityDao getEntityDao() {
      return this.vipLogFriendDao;
   }

   /**
   * <p>分页查询VipLogFriend<br>
   * @param PageRequest pr
   * @return Page 
   */
   @Transactional(readOnly=true)
   public Page findByPageRequest(PageRequest pr) {
      return vipLogFriendDao.findByPageRequest(pr);
   }

   /**
   * <p>批量删除 VipLogFriend<br>
   * @param VipLogFriend u
   * @return Boolean 
   */
   public Boolean  removeByIdArry(VipLogFriend u) {
      Boolean result =false;
      int i =-1,size=u.getIdList().size();
      i =vipLogFriendDao.removeByIdArry(u);
      if(i==size){
         result =true;
      }else{
         throw new RuntimeException();
      }
      return result;
   }
	/**
	* <p> Bean查询 <br> 
	* @param VipLogFriend bean
	* @return  VipLogFriend 
	*/

	/**
	* <p>按Bean查询返回List<br> 
	* @param VipLogFriend bean
	* @return List 
	*/
	public java.util.List  findListByBean(VipLogFriend u) { 
		java.util.List<VipLogFriend> list =  vipLogFriendDao.findListByBean(u); 
	    return list;
	}
    /**
     * <p>标题: 通讯录-新的朋友/验证消息-列表
     * <p>参数: String menberId  会员ID
     * <p>描述:  
     * @see phapp.model.barapp.VipLogFriend
     * @see phapp.model.barapp.vipMain  
     */
    public List  getNewFriendList(java.util.Map map)  {
		java.util.List<VipLogFriend> list =  vipLogFriendDao.getNewFriendList(map); 
	    return list;
    }
    /**
     * <p>标题: 通过验证｜拒绝添加-新朋友请求
     * <p>参数: String mainId  主动者会员Id ,String recipientId 被加者会员Id,String circuit 状态或流程:1申请,2同意,3不同意,4删除好友,5黑名单,6其它
     * <p>描述:  
     * @see phapp.model.barapp.VipLogFriend 
     */
    public int verifyFriend (java.util.Map map ) {
    	 return  vipLogFriendDao.verifyFriend(map);
    }
	/**
	 * <p>通过 Map 修改一条 数据<br> 
	 * @param  java.util.Map 
	*/
    public int updateByMap(java.util.Map map){
    	int count = vipLogFriendDao.updateByMap(map);
    	return count;
    }
    

    
    
    
}
